﻿@model Role
<tr class="item-container" id="@string.Format("container{0}",Model.Id)">
    <td>
        <!-- Split button -->
        <div class="btn-group">
            <button type="button" class="btn btn-primary">操作</button>
            <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <span class="caret"></span>
                <span class="sr-only">Toggle Dropdown</span>
            </button>
            <ul class="dropdown-menu">

                @if (!Model.IsSys)
                {
                    <li>
                        @Ajax.RawActionLink("<i class='fa fa-edit fa-fw'></i>编辑",
                        "EditRole", "Role",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "edit-container", OnComplete = "onAjaxComplete" },
                        new { title = "编辑角色" })
                    </li>
                }



                <li>
                    @Ajax.RawActionLink("<i class='fa fa-user-secret fa-fw'></i>权限",
                        "SetRoleMenus", "Role",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "menus-container", OnComplete = "onAjaxCompleteRoleMenus" },
                        new { title = "编辑权限" })

                </li>
                @if (!Model.IsSys)
                {
                    <li>
                        <a href="@Url.Action("Delete", new { id = Model.Id })" data-confirm="你确定要删除此 @Model.RoleName 吗？" class="delete-item" data-toggle="tooltip" data-placement="top" title="删除">
                            <i class="fa fa-trash-o fa-fw"></i> 删除
                        </a>
                    </li>
                }

            </ul>
        </div>

    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.RoleName)
        @if (Model.IsSys)
        {
            <span class="badge badge-primary">系统</span>
        }

    </td>
    <td>
        @Html.DisplayFor(modelItem => Model.Description)
    </td>

</tr>